function rtSurfType(lsm, tsu) result(surftype)
    use iasing_osse
    implicit none
    ! Arguments
    real(JPR4), intent(in) :: lsm, tsu
    integer :: surftype

    if (lsm > 0.5) then
        surftype = 0
    else if (tsu > T0) then
        surftype = 1
    else
        surftype = 2
    endif
end function

